//bool, ObjList objs, str OUT reasonText

Building this;
str name, envs;
this = objs[0].AsBuilding();

if (.IsValid()){
	
	if (.settlement.IsVillage()) // when anuy village house is damages
	{
		ObjList olBuildings;
		Building b;
		int i;                

		olBuildings = .settlement.Buildings();
		for (i=0; i<olBuildings.count();i+=1)
		{
			b = olBuildings[i];
			if (!b.IsValid()) continue;
			if (b.IsBroken() && b.IsVeryBroken() && .settlement.population<GetConst("MinPopulation"))
			return false;	
		}
	}         

	name = cmdparam;  
	envs = EnvReadString(.settlement, name);
	if(name == "stoptribute_food" || name == "stoptribute_gold" || name == "stoptribute_people"){
	
		if(envs == "" || envs == "on")
			return false;	
	
	} else if(name == "tribute_food" || name == "tribute_gold" || name == "tribute_people"){
		if(envs == "on")
			return false;	
	}
}
return true;
